"""
type、object和class之间的关系

核心知识点：
    1.type->class->object
    2.object是最顶层基类
    3.type也是一个类，同时也是一个对象
"""

age = 18
name = "kevin"


def print_type():
    print(type(18))
    print(type(int))
    print(type(name))
    print(type(str))
    # 输出结果
    """
    <class 'int'>
    <class 'type'>
    <class 'str'>
    <class 'type'>
    """


class Student:
    pass


class MyStudent(Student):
    pass


def print_student_type():
    student = Student()
    print(type(student))
    print(type(Student))
    print(int.__bases__)
    print(str.__bases__)
    print(Student.__bases__)
    print(MyStudent.__bases__)
    print(type.__bases__)
    print(object.__bases__)
    print(type(object))


if __name__ == '__main__':
    print_type()
    print_student_type()

    # 输出结果
    """
    <class '__main__.Student'>
    <class 'type'>
    (<class 'object'>,)
    (<class 'object'>,)
    (<class 'object'>,)
    (<class '__main__.Student'>,)
    (<class 'object'>,)
    ()
    <class 'type'>
    """
